package cn.iocoder.an.module.business.controller.admin.equipmentmanage.vo;

import cn.idev.excel.annotation.ExcelIgnore;
import cn.idev.excel.annotation.ExcelProperty;
import cn.idev.excel.annotation.format.DateTimeFormat;
import cn.iocoder.an.framework.excel.core.annotations.DictFormat;
import cn.iocoder.an.framework.excel.core.convert.DictConvert;
import com.baomidou.mybatisplus.annotation.FieldStrategy;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateSerializer;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.Date;
import java.util.List;

/**
 * 用户 Excel 导入 VO
 */
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@Accessors(chain = false) // 设置 chain = false，避免用户导入有问题
public class EquipmentImportExcelVO {

    @ExcelIgnore
    private Long id;

    @ExcelProperty("设备编码")
    private String code;

    @ExcelProperty("设备名称")
    private String equipmentName;

    @ExcelIgnore
    private Long deptId;

    @ExcelProperty("所属部门")
    private String deptName;

    @ExcelIgnore
    private Long equipmentClassify;

    @ExcelProperty("设备分类名称")
    private String equipmentClassifyName;


    @ExcelProperty(value = "设备状态", converter = DictConvert.class)
    @DictFormat("equipment_status") // TODO 代码优化：建议设置到对应的 DictTypeConstants 枚举类中
    private Integer equipmentStatus;

    @ExcelProperty(value = "设备类型", converter = DictConvert.class)
    @DictFormat("equipment_type") // TODO 代码优化：建议设置到对应的 DictTypeConstants 枚举类中
    private Integer equipmentType;


    @ExcelProperty("规格型号")
    private String equipmentModel;

    @ExcelProperty("设备功率kw")
    private String equipmentPower;

    @ExcelProperty("设备重量")
    private String equipmentWeight;

    @ExcelProperty("设备吨位")
    private String equipmentTonnage;

    @ExcelProperty("安装位置")
    private String installPosition;

    @JsonFormat(pattern = "yyyy-MM-dd")
    @DateTimeFormat("yyyy-MM-dd")
    @ExcelProperty(value = "安装日期")
    private Date installDate;

    @ExcelProperty("投产日期")
    @DateTimeFormat("yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date productionDate;

    @ExcelProperty("单位")
    private String unit;

    @ExcelProperty("设备厂家")
    private String equipmentProducer;

    @ExcelProperty("联系人")
    private String contacts;

    @ExcelProperty("联系电话")
    private String contactsNumber;

    @ExcelProperty(value = "使用状态", converter = DictConvert.class)
    @DictFormat("equipment_status") // TODO 代码优化：建议设置到对应的 DictTypeConstants 枚举类中
    private Integer useType;

    @ExcelProperty("最近一次保养时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime maintainDatetime;

    @ExcelProperty("下次保养时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime nextMaintainDatetime;

    @ExcelProperty("上次点检时间")
    @TableField(updateStrategy = FieldStrategy.ALWAYS)
    private LocalDateTime lastCheckTime;

    @ExcelProperty("备注")
    private String remark;


    /**
     * 最近一次维护时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ExcelProperty("上次维护时间")
    private LocalDateTime lastMaintainTimeDamage;
    /**
     * 下次维护时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ExcelProperty("下次维护时间")
    private LocalDateTime nextMaintainTimeDamage;


    

}
